<?php

namespace App\Service\Index;

use App\Model\Setting\SettingAppHidden;
use App\Service\BaseService;

/**
 * 功能屏蔽
 */
class FuncShieldingService extends BaseService
{
    public function handle()
    {
//        return [
//            'gift_kg' => 1
//        ];

        $appId   = $this->request->input('appid', 0);
        $version = $this->request->input('version', '');
        $channel = $this->request->input('channel', 0);

        if (empty($appId) || empty($version) || empty($channel)) {
            $giftKg = 1;
        } else {
            $giftKg = SettingAppHidden::checkGiftKgHiddenByUser($version, $channel, SettingAppHidden::FUNC_GIFT);
        }

        return [
            'gift_kg' => $giftKg
        ];
    }
}
